package com.igeek.ch01;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * TODO
 *
 * @author xuxin
 * @since 2024/5/20
 */

public class ConfigTest {
    public static void main(String[] args) {
        ApplicationContext ac = new AnnotationConfigApplicationContext(MyConfig.class);
        //注意获取Bean
        Student s = ac.getBean("stu", Student.class);
        s.setName("张三");
        s.setPassWord("123");
        System.out.println(s.getName());
        System.out.println(s.getPassWord());
        System.out.println(s);
        /*Student s1 = ac.getBean("student", Student.class);
        s1.setName("李四");
        s1.setPassWord("789");
        System.out.println(s1.getName());
        System.out.println(s1.getPassWord());
        System.out.println(s1);*/
    }
}
